var maxwidth_1=26;
var maxwidth_2=26;
$(document).ready(function(){
	$(".turnback a").attr("href","index1.html");
    var $groupid =getUrlParam("groupid");
    var $mid = getUrlParam("mid");
    var token =window.localStorage.getItem("token");
    var Post ="groupid="+$groupid+"&mid="+$mid+"&pagesize=5&token="+token+"&did=22222";
	$.ajax({
		url:'../api/group/getgroupdynamicinfolist',
		type:'post',
		data:Post,
		success:function(msg){
			if(msg.code ==100){
				console.log(msg);
				for(var i = 0;i < msg.data.length;i++){
				var title = msg.data[i].n2.length>maxwidth_1?msg.data[i].n2.substring(0,maxwidth_1)+"...":msg.data[i].n2;
				var description = msg.data[i].n3.length>maxwidth_2?msg.data[0].n3.substring(0,maxwidth_2)+"...":msg.data[i].n3;
				var li  = document.createElement("li");
				li.innerHTML = '<a href="trendsInfo.html?did='+msg.data[i].n0+'"><div class="logo"><img src ="'+
				msg.data[i].n1+'" src/><span class="time">'+
				msg.data[i].n4.substring(0,10)+'</span></div><div class="dymanic"><span class="title">'+
				title+'</span><span class="include">'+
				description+'</span><span class="name">爱吃猫的鱼</span>'
	            +'<span class="comment">评分</span></div></a>';
				$(".content ul").append(li);
				}
			}
		}
	});
});

function getUrlParam(name) {
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
	var r = window.location.search.substr(1).match(reg);
	if (r != null) return unescape(r[2]); return null;
}








